<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">  
    <title>意见反馈</title>
    <link rel="stylesheet" href="__PUBLIC__/Home/css/member.css">
    <include file="Public/common_js"/>
</head>
<body style="background:white;">
	<div class="warp">
        <form action="{:url('Member/doMemberMyFeedback')}" method="post" accept-charset="UTF-8" class="form-horizontal" pjax-container="">
            <div class="feedback">
                <p>我们知道怡臣还不太成熟，还有许多需要改进的地方，所以需要您来吐槽帮助我们发现问题。您的意见是我们前进的动力^_^</p>
                <textarea name="comment" id="comment" placeholder="请输入您的反馈意见"></textarea>
                <p>输入你的手机号，我们将第一时间给你反馈。</p>
                <input type="number" name="mobile" id="mobile" value="{$mobile}" placeholder="手机号码">
                <p><div class="btn btn-second btn-block" onclick="ajax_sub();">提交</div></p>
            </div>
        </form>
	</div>
    <script type="text/javascript">
		require(['memberMyfeedback']);
        var _isAjaxIdUpload = false;
        function ajax_sub() {
            if(_isAjaxIdUpload) {
                return;
            }
            _isAjaxIdUpload = true;

            var _data;
            var comment = $('#comment').val();
            var mobile = $('#mobile').val();
            _data = {"comment" : comment, "mobile" : mobile};
            $.ajax({
                type:'post',
                url:"{:url('Member/doMemberMyFeedback')}",
                dataType: 'json',
                data:_data ,
                success:function(rs){
                    _global.promote.alertPopup(rs);
                    if(rs== '1'){
                        _global.promote.alertPopup('您的建议我们已收到！');
                        setTimeout(function(){
                            window.location.href = "{:url('Member/index')}";
                        },2000);
                    }else {
                        _global.promote.alertPopup('请输入完整信息！');
                    }
                    _isAjaxIdUpload = false;
                },
                error:function(){
                    _isAjaxIdUpload = false;
                    _global.promote.alertPopup('服务器异常请稍后重试！');
                }
            })
        }
	</script>
</body>
</html>
